﻿<ribbon:RibbonWindow x:Class="RegexMaster.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" Title="Regex Master 2.0 - http://alexandershapovalov.com/" x:Name="RibbonWindow" Width="640" Height="480" Loaded="RibbonWindow_Loaded"
xmlns:WinForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" Icon="/RegexMaster;component/Images/application-icon-128.png">

	<Grid x:Name="LayoutRoot">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="30" MaxHeight="55" MinHeight="30" />
			<RowDefinition Height="5" />
			<RowDefinition Height="3*" />
			<RowDefinition Height="5" />
			<RowDefinition Height="2*" />

		</Grid.RowDefinitions>

		<Grid.Resources>
			<Style x:Key="TextFields" TargetType="TextBox">
				<Setter Property="Margin" Value="0"></Setter>
			</Style>
		</Grid.Resources>

		<ribbon:Ribbon x:Name="Ribbon">
			<ribbon:Ribbon.ApplicationMenu>
				<ribbon:RibbonApplicationMenu SmallImageSource="Images\tools-16.png">
					<ribbon:RibbonApplicationMenuItem Header="Exit" x:Name="MenuItem1" ImageSource="Images\application-exit-32.png" Click="Application_Exit" />
				</ribbon:RibbonApplicationMenu>
			</ribbon:Ribbon.ApplicationMenu>
			<ribbon:RibbonTab x:Name="HomeTab" Header="Home" >
				<ribbon:RibbonGroup x:Name="Group1" Header="">
					<ribbon:RibbonButton x:Name="Button1" LargeImageSource="Images\application-exit-32.png" Label="Exit" Click="Application_Exit" />

					<ribbon:RibbonButton x:Name="Button2" SmallImageSource="Images\clear-16.png" Label="Clear fields" ToolTip="Clears all text fields" Click="ClearTextFields_Click" />
                    <ribbon:RibbonButton SmallImageSource="Images\reload-16.png" Label="Reload" ToolTip="Runs regex agains text again" Click="MenuDoRegex_Click" />
				</ribbon:RibbonGroup>
                <ribbon:RibbonGroup Header="Settings">
                    <ribbon:RibbonCheckBox x:Name="ignoreCaseCheckBox" Label="Ignore case" IsChecked="True" />
                    <ribbon:RibbonCheckBox x:Name="isMultiline" Label="Is Multiline" IsChecked="True" />
                </ribbon:RibbonGroup>

			</ribbon:RibbonTab>
			<ribbon:RibbonTab Header="About" Name="AboutTab">
                <ribbon:RibbonGroup>
                    <Label Content="Regex Master 2.0" HorizontalAlignment="Left"  FontWeight="Bold" Padding="0 30 0 10" />
                </ribbon:RibbonGroup>
                <ribbon:RibbonGroup>
                    
                    <Label Content="Design and development: Alexander Shapovalov" Height="28" HorizontalAlignment="Left"    />
                    <TextBlock>
                        <Hyperlink Click="Navigate_to_Website">http://alexandershapovalov.com/</Hyperlink>
                    </TextBlock>
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>

		</ribbon:Ribbon>
		<TextBox x:Name="txtRegexExpression" Grid.Row="1" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" FontSize="16" FontFamily="Comic Sans MS" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" KeyUp="OnDoRegexEvent"></TextBox>
		<GridSplitter Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Background="#FFBCBCBC" ResizeDirection="Rows"></GridSplitter>

        <WindowsFormsHost Grid.Row="3">
            <WinForms:RichTextBox x:Name="richSourceText"></WinForms:RichTextBox>
        </WindowsFormsHost>
        
<!--
		<RichTextBox x:Name="richSourceText" Grid.Row="3" Style="{StaticResource ResourceKey=RichFields}" VerticalScrollBarVisibility="Auto" KeyUp="OnDoRegexEvent" FontSize="14" FontFamily="Arial"></RichTextBox>
-->
		<GridSplitter Grid.Row="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Background="#FFBCBCBC" ResizeDirection="Rows"></GridSplitter>

		<TextBox x:Name="txtSplit" Grid.Row="5" Style="{StaticResource ResourceKey=TextFields}" VerticalScrollBarVisibility="Auto" IsReadOnly="True" AcceptsReturn="True" AcceptsTab="True"></TextBox>
        
    </Grid>
</ribbon:RibbonWindow>